import java.util.Arrays;
    class WashMachine {
        //属性 、 字段 、成员变量：这些成员变量是定义在方法外部 类的内部的
        public String brand; // 品牌
        public String type; // 型号
        public double weight; // 重量
        public double length; // 长
        public double width; // 宽
        public double height; // 高
        public String color; // 颜色

        //成员方法 -> 行为
        public void washClothes(){ // 洗衣服
            System.out.println("洗衣功能");
        }

        public void dryClothes(){ // 脱水
            System.out.println("脱水功能");
        }
        public void setTime(){ // 定时
            System.out.println("定时功能");
        }
    }



    class Student {
        public String name;
        public double score;
        public int age;

        //.....

        public void DoClass(){}
        public void DoHomework(){}
        public void Exam(){}

    }
    class Dog {
        public String name;
        public String color;
        public int age;

        //-> 行为
        public void barks() {
            System.out.println(name + ": 旺旺旺~~~");
        }
        public void wag() {
            System.out.println(name + ": 摇尾巴~~~");
        }
    }
    public class test {

        public static void main(String[] args) {
            Dog dog1 = new Dog();
            dog1 = new Dog();
            dog1 = new Dog();
            dog1 = new Dog();
            dog1 = new Dog();
            dog1 = new Dog();
            dog1 = new Dog();

            int a = 10;
            a = 20;
            a = 30;
            a = 40;

            Dog dog2 = null;
        }

        public static void main4(String[] args) {
            //实例化对象
            Dog dog1 = new Dog();
            dog1.name = "阿黄";
            dog1.age = 2;
            dog1.color = "黄色";
            System.out.println("年龄："+dog1.age);
            System.out.println("姓名："+dog1.name);
            System.out.println("颜色："+dog1.color);
            dog1.barks();
            dog1.wag();

            System.out.println();

            Dog dog2 = new Dog();
            dog2.name = "旺财";
            dog2.age = 3;
            dog2.color = "黑色";
            System.out.println("年龄："+dog2.age);
            System.out.println("姓名："+dog2.name);
            System.out.println("颜色："+dog2.color);
            dog2.barks();
            dog2.wag();

            //我可以通过new 关键字 来实例化 多个对象
            Dog dog3 = new Dog();
            Dog dog4 = new Dog();
            Dog dog5 = new Dog();

            int a = 10;

        }

        public static void main3(String[] args) {
            //Java 当中 二维数组 在定义的时候 是可以省略掉列的
            int[][] array = new int[2][];//不规则数组
            //对 每一维数组 进行了初始化
            array[0] = new int[3];
            array[1] = new int[5];
            for (int i = 0; i < array.length; i++) {
                for (int j = 0; j < array[i].length; j++) {
                    System.out.print(array[i][j]+" ");
                }
                System.out.println();
            }
        }
        public static void main2(String[] args) {

       /* System.out.println(array.length);//行
        System.out.println(array[0].length);//列
        System.out.println(array[1].length);*/
            int[][] array = {{1,2,3,4,5,6,7,8,9,},{4,5,6}};
            for (int i = 0; i < array.length; i++) {
                for (int j = 0; j < array[i].length; j++) {
                    System.out.print(array[i][j]+" ");
                }
                System.out.println();
            }

            System.out.println();
            for(int[] tmpArray : array) {
                for(int x : tmpArray) {
                    System.out.print(x+" ");
                }
                System.out.println();
            }
            System.out.println();
            String ret = Arrays.deepToString(array);
            System.out.println(ret);
        }
        public static void main1(String[] args) {
            int[][] array = {{1,2,3},{4,5,6}};
            for (int i = 0; i < 2; i++) {
                for (int j = 0; j < 3; j++) {
                    System.out.print(array[i][j]+" ");
                }
                System.out.println();
            }


            int[][] array2 = new int[][]{{1,2,3},{4,5,6}};
            int[][] array3 = new int[2][3];//默认初始化为 0

        }
    }

